package com.stockz.core.manager;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.stockz.core.dao.ExchangeDao;
import com.stockz.core.model.Exchange;

@Component
@Transactional
public class ExchangeManager{

	@Autowired
	private ExchangeDao exchangeDao;
	
	
	@Transactional(propagation=Propagation.REQUIRED)
	public void checkBseExchange(){
		Exchange bseExchange = new Exchange();
		bseExchange.setCode("BSE");
		bseExchange.setName("Bombay Stock Exchange");
		exchangeDao.persistOrUpdate(bseExchange);
	}
	
}
